#pragma once
#include "Renderer/Camera.h"
#include "glm/glm.hpp"
namespace Orange {


	class SceneCamera : public Camera
	{
	public:
		enum class PrejectionType {
			Perspective = 0,
			Orthographic = 1
		};
	public:
		SceneCamera();
		~SceneCamera() = default;

		void SetViewportSize(uint32_t width, uint32_t height);
		void SetOrthographic(float size, float cameraNear, float cameraFar);
		void SetPerspection(float fov, float cameraNear, float cameraFar);
		void CalcCameraPrejectMatrix();

		// �����������
		void SetOrthographicSize(float size) {
			m_CameraViewportSize = size; CalcCameraPrejectMatrix();};
		float GetOrthographicSize() {return m_CameraViewportSize;};

		void SetOrthographicNear(float OrthoNear) {
			m_CameraNear = OrthoNear;
			CalcCameraPrejectMatrix();
		};
		float GetOrthographicNear() { return m_CameraNear; };

		void SetOrthographicFar(float OrthoFar) {
			m_CameraFar = OrthoFar;
			CalcCameraPrejectMatrix();
		};
		float GetOrthographicFar() { return m_CameraFar; };

		// ����͸�����
		void SetPerspectFov(float fov) {
			m_CameraPerspectFov = fov; CalcCameraPrejectMatrix();
		};
		float GetPerspectFov() { return m_CameraPerspectFov; };

		void SetPerspectNear(float perspectNear) {
			m_CameraPerspectNear = perspectNear;
			CalcCameraPrejectMatrix();
		};
		float GetPerspectNear() { return m_CameraPerspectNear; };

		void SetPerspectFar(float perspectFar) {
			m_CameraPerspectFar = perspectFar;
			CalcCameraPrejectMatrix();
		};
		float GetPerspectFar() { return m_CameraPerspectFar; };

		PrejectionType GetPrejectionType() { return m_Prejection; };
		void SetPrejectionType(PrejectionType prejection) {  m_Prejection = prejection; CalcCameraPrejectMatrix();
		};

	private:
		float m_CameraViewportSize = 10.0f;
		float m_CameraNear = -1.0f;
		float m_CameraFar = 1.0f;


		float m_CameraPerspectFov = glm::radians(45.0f);
		float m_CameraPerspectNear = 0.01f;
		float m_CameraPerspectFar = 1000.0f;

		float m_aspect = 1.0f;
		PrejectionType m_Prejection = PrejectionType::Orthographic ;
	};

}